#include<stdio.h>
int main(){
	float price,ele;
	scanf("%f",&ele);
	if(ele<=110) price=ele*0.5;
	else if(ele<=210) price=55+(ele-110)*0.55;
	else price=55+0.55*100+(ele-210)*0.7;
	printf("%.2f",price);
	return 0;
}
